package com.icedevcloud.upms.api.dict;

import com.icedevcloud.common.core.api.R;
import com.icedevcloud.common.core.constant.ServiceNameConstants;
import com.icedevcloud.upms.api.dict.dto.DictSimpleResDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 字典远程调用 FeignService
 *
 * @author dengbing
 * @since 2023-09-10
 */
@Tag(name = "字典远程调用")
@FeignClient(
        contextId = "ISysDictFeignService",
        value = ServiceNameConstants.UPMS,
        path = "/provider/sysDict"
)
public interface ISysDictProvider {

    @Operation(summary = "根据字典类型获取字典")
    @PostMapping("/getDictByDictType")
    R<List<DictSimpleResDto>> getDictByDictType(@RequestParam(name = "dictType") String dictType);

    @Operation(summary = "根据字典类型和字典编码获取字典")
    @PostMapping("/getDictByDictTypeAndDictCode")
    R<DictSimpleResDto> getDictByDictTypeAndDictCode(@RequestParam(name = "dictType") String dictType,
                                                           @RequestParam(name = "dictCode") String dictCode);

}
